import {observable, action} from 'mobx';
import { SearchAdvanced,ListAdvanced,RouteLayout } from 'weaver-mobile-page';
// import * as API from '../../api/search'

export default class SearchWorkplanStore {
  
  @observable listAd = new ListAdvanced.Store({ route: '/calendar/search', id: 'meetingSearchList' });
  // 目前搜索历史存放 localStorage，需要指定固定 id

  @observable dataFetchOptions={ url: '/api/workplan/search/getlist',method: 'post'}
  
  @observable  conditionFetchOptions={ url: '/api/workplan/search/getCondition',method: 'POST'}

  @observable searchLayout = new RouteLayout.Store({route: '/calendar', id:'search'})


  @action
  setState = (params = {}) => {
    Object.keys(params).forEach((key) => {
      this[key] = params[key];
    });
  }

    
  @action
  getConditon(search) {
    search.getData({
      url: '/api/workplan/search/getCondition',
      method: 'POST',
    })
  }
}